<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>模板语法-文本</title>
</head>
<body>
  <div id="app">
    <div v-if="flag">如果为真我就显示</div>
    <div v-else>如果为假我就显示</div>

    {{ count }}
    <div v-if="count < 3">0-3</div>
    <div v-else-if="count < 6">3-6</div>
    <div v-else-if="count < 9">6-9</div>
    <div v-else>9-10</div>

    <div v-show="flag">如果为真我就显示</div>
    <div v-show="!flag">如果为假我就显示</div>
  </div>
</body>
<script src="vue.js"></script>
<script>
  new Vue({
    el: '#app',
    data: {
      flag: true,
      count: Math.random() * 10
    }
  })
</script>
</html>